﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="imageComments.aspx.vb" Inherits="Web_2._0_BMW___X6_Experts_Web_Application.imageComments" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        #imageCommentA
        {
            height: 360px;
        }
        .commentB
        {
            height: 390px;
            width: 914px;
        }
        .pCommentB
        {
            width: 372px;
            height: 272px;
        }
        .pCommentC
        {
        }
        .style2
        {
            font-weight: normal;
            font-size: medium;
            font-family: Calibri;
        }
        .style3
        {
            font-size: medium;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="imageCommentA">
    <div class ="commentB" style="font-size: x-large; font-weight: bolder;">
        <p style="text-decoration: underline">Comments</p>
        <div class = "text100" 
            style="font-size: small; font-weight: normal; font-style: normal">
        
        
        
            So, you like your BMW - X6&#39;s then why not comment on this picture? It doesnt 
            cost you anything...<br />
                Click <a href = "Account/Register.aspx">here</a> to register or registered users can simply just <a href = "Account/Login.aspx">login</a>.<br />
            <br />
        
        
        
        </div>

        <div class = "pCommentC">
    
    
        <br />
        <asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource3" 
            Height="204px" Width="494px" BorderStyle="Solid" Font-Size="Large" 
            CssClass="pCommentC" >
            <EditItemTemplate>
                <strong>Description:</strong>
                <asp:TextBox ID="ImageDescriptionTextBox" runat="server" 
                    Text='<%# Bind("ImageDescription") %>' />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                <br />
                <strong>Uploaded by:</strong>
                <asp:TextBox ID="UserNameTextBox" runat="server" 
                    Text='<%# Bind("UserName") %>' />
                <br />

                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                    CommandName="Update" Text="Update" />
                &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </EditItemTemplate>
            <InsertItemTemplate>
                <strong>Description:</strong>
                <asp:TextBox ID="ImageDescriptionTextBox" runat="server" 
                    Text='<%# Bind("ImageDescription") %>' />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                <br />
                <strong>Uploaded by:</strong>
                <asp:TextBox ID="UserNameTextBox" runat="server" 
                    Text='<%# Bind("UserName") %>' />
                <br />

                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                    CommandName="Insert" Text="Insert" />
                &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </InsertItemTemplate>
            <ItemTemplate>
                <strong> Description:</strong>
                <asp:Label ID="ImageDescriptionLabel" runat="server" 
                    Text='<%# Bind("ImageDescription") %>' />
                <br />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:Label ID="TimeUploadedLabel" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                <br />
                <br />
                <strong>Uploaded by:</strong>
                <asp:Label ID="UserNameLabel" runat="server" Text='<%# Bind("UserName") %>' />
                <br />


            </ItemTemplate>
        </asp:FormView>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT Images.ImageDescription, Images.DateUploaded, Images.TimeUploaded, aspnet_Users.UserName, Images.ImageID FROM (Images INNER JOIN aspnet_Users ON Images.UserIDFK = aspnet_Users.UserId) WHERE (Images.ImageID = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="?" QueryStringField="id" />
            </SelectParameters>
        </asp:SqlDataSource>
    
    
    </div>
    <div class = "pCommentB">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource1" Height="222px" PageSize="1" Width="340px" 
            style="margin-right: 31px">
        <Columns>
            <asp:ImageField DataAlternateTextField="ImageLink" 
                DataImageUrlField="ImageLink" HeaderText="***Image Comments***">
                <ControlStyle CssClass="imageCommentsImage" />
                <FooterStyle CssClass="imageCommentsImage" />
                <HeaderStyle Height="0px" />
                <ItemStyle BorderStyle="None" CssClass="imageCommentsImage" />
            </asp:ImageField>
        </Columns>
    </asp:GridView>
    
    </div>
    <br />
    <br />

    <div class = "listOfAssignedTags">
    
    <div class = "style2">
    
    
        <span class="style3">To place a tag, you must be a registered user and logged 
        in. Click here to 
        <a href = "Account/Register.aspx">Register</a> or </span> <a href = "Account/Login.aspx">
        <span class="style3">Login</span></a>.</div>
    
        <br />
        <span class="sitemainfooter">This image has been tagged the following:</span><br />
    
    
    
        <asp:ListBox ID="ListBox1" runat="server" DataSourceID="SqlDataSource4" 
            DataTextField="TagName" DataValueField="TagName" Height="248px" 
            Width="299px" style="text-align: left" Font-Names="Calibri" 
            Font-Size="Medium">
        </asp:ListBox>
        <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT Tags.TagName, Image_Tags.ImageIDFK FROM (Image_Tags INNER JOIN Tags ON Image_Tags.TagIDFK = Tags.TagID) WHERE (Image_Tags.ImageIDFK = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="?" QueryStringField="id" />
            </SelectParameters>
        </asp:SqlDataSource>
    
    
    
    </div>
    

    
    </div>


   </div>
        
        <div class = "text20" 
        
    style="font-size: medium; font-style: italic; font-weight: bold; height: 21px;">

            <br />

        User Comments for this Image&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            Current Tags</div>
        
        <br />
        &nbsp;<br />
    <div class = "commentB">
    
    

        <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource2">
            <AlternatingItemTemplate>
                <span style=""><strong>Comment:</strong>
                <span style=" color:#3366FF"><asp:Label ID="CommentBodyLabel" runat="server" 
                    Text='<%# Eval("CommentBody") %>' /> </span>
                <br />
                <strong>Date Uploaded:</strong>
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Eval("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:Label ID="TimeUploadedLabel" runat="server" 
                    Text='<%# Eval("TimeUploaded") %>' />
                <br />
                <strong>Comment Posted by:</strong>
                <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                <br />
                <br />
                </span>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                <span style=""><strong>Comment:</strong>
                 <span style=" color:#3366FF"><asp:TextBox ID="CommentBodyTextBox" runat="server" 
                    Text='<%# Bind("CommentBody") %>' /> </span>
                <br />
                <strong>Date Uploaded:</strong>
                <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                <br />
                <strong>Comment Posted by</strong>
                <asp:TextBox ID="UserNameTextBox" runat="server" 
                    Text='<%# Bind("UserName") %>' />
              
                <br />
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                    Text="Update" />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Cancel" />
                <br />
                <br />
                </span>
            </EditItemTemplate>
            <EmptyDataTemplate>
                <span>No data was returned.</span>
            </EmptyDataTemplate>
            <InsertItemTemplate>
                <span style=""><strong>Comment:</strong>
                 <span style=" color:#3366FF"><asp:TextBox ID="CommentBodyTextBox" runat="server" 
                    Text='<%# Bind("CommentBody") %>' /></span>
                <br />
                <strong>Date Uploaded:</strong>
                <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                <br />
                <strong>Comment Posted by:</strong>
                <asp:TextBox ID="UserNameTextBox" runat="server" 
                    Text='<%# Bind("UserName") %>' />
                <br />
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                    Text="Insert" />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Clear" />
                <br />
                <br />
                </span>
            </InsertItemTemplate>
            <ItemTemplate>
                <span style=""><strong>Comment:</strong>
                 <span style=" color:#3366FF"><asp:Label ID="CommentBodyLabel" runat="server" 
                    Text='<%# Eval("CommentBody") %>' /></span>
                <br />
                <strong>Date Uploaded:</strong>
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Eval("DateUploaded") %>' />
                <br />
               <strong>Time Uploaded:</strong>
                <asp:Label ID="TimeUploadedLabel" runat="server" 
                    Text='<%# Eval("TimeUploaded") %>' />
                <br />
                <strong>Comment Posted by:</strong>
                <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                <br />
                <br />
                </span>
            </ItemTemplate>
            <LayoutTemplate>
                <div ID="itemPlaceholderContainer" runat="server" style="">
                    <span runat="server" id="itemPlaceholder" />
                </div>
                <div style="">
                    
                </div>
            </LayoutTemplate>
            <SelectedItemTemplate>
                <span style="">CommentBody:
                <span style="color: #3366FF"><asp:Label ID="CommentBodyLabel" runat="server" 
                    Text='<%# Eval("CommentBody") %>' /> </span>
                <br />
                DateUploaded:
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Eval("DateUploaded") %>' />
                <br />
                TimeUploaded:
                <asp:Label ID="TimeUploadedLabel" runat="server" 
                    Text='<%# Eval("TimeUploaded") %>' />
                <br />
                UserName:
                <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                <br />
                <br />
                </span>
            </SelectedItemTemplate>
        </asp:ListView>
        <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="4">
            <Fields>
                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                <asp:NumericPagerField />
                <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
            </Fields>
        </asp:DataPager>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            
            SelectCommand="SELECT Image_Comments.CommentBody, Image_Comments.DateUploaded, Image_Comments.TimeUploaded, aspnet_Users.UserName, Image_Comments.ImageID, Image_Comments.ImageCommentID FROM (Image_Comments INNER JOIN aspnet_Users ON Image_Comments.UserID = aspnet_Users.UserId) WHERE (Image_Comments.ImageID = ?) ORDER BY Image_Comments.ImageCommentID DESC">
            <SelectParameters>
                <asp:QueryStringParameter Name="?" QueryStringField="id" />
            </SelectParameters>
        </asp:SqlDataSource>
    
    

    </div>


    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT [ImageLink] FROM [Images] WHERE ([ImageID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ImageID" QueryStringField="id" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
</asp:Content>
